import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/detail',
    name:'detail',
    component:()=>import("../views/Detail.vue")
  },
  {
    path:'/',
    name:'index',
    component:()=>import("../views/Index.vue"),
    children:[
      {
        path: '/',
        name: 'Home',
        component: Home
      },
      {
        path:'/book',
        name:'book',
        component:()=>import("../views/Book.vue")
      },
      {
        path:'/shopcar',
        name:'shopcar',
        component:()=>import("../views/Shopcar.vue")
      },
      {
        path:'/my',
        name:'my',
        component:()=>import("../views/My.vue")
      },
    ]
  },
  
]

const router = new VueRouter({
  routes
})

export default router
